/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.shinyray.project.entity;

import com.shinyray.org.entity.Orgnization;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * 项目合作协议.
 * @author Administrator
 */
@Entity
public class CPP implements Serializable {
    @OneToMany(mappedBy = "cpp")
    private List<AccountReceivable> accountReceivableList;
    @OneToMany(mappedBy = "cpp")
    private List<AccountPayable> accountPayableList;
    @ManyToOne
    private Project project;
    private static final long serialVersionUID = 1L;
    //签收情况
    @OneToMany
    private List<CPPSignIn> cppSignInList;
    //签出情况
    @OneToMany
    private List<CPPSignOut> cppSignOutList;
    //协议主管方
    @ManyToOne
    private Orgnization masterOrg;
    //合作伙伴
    @OneToMany
    private List<Orgnization> cppPartners;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CPP)) {
            return false;
        }
        CPP other = (CPP) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.shinyray.project.entity.OutSourcingCPP[id=" + id + "]";
    }

    public List<Orgnization> getCppPartners() {
        return cppPartners;
    }

    public void setCppPartners(List<Orgnization> cppPartners) {
        this.cppPartners = cppPartners;
    }

    public List<CPPSignIn> getCppSignInList() {
        return cppSignInList;
    }

    public void setCppSignInList(List<CPPSignIn> cppSignInList) {
        this.cppSignInList = cppSignInList;
    }



    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

    public List<CPPSignOut> getCppSignOutList() {
        return cppSignOutList;
    }

    public void setCppSignOutList(List<CPPSignOut> cppSignOutList) {
        this.cppSignOutList = cppSignOutList;
    }

    public Orgnization getMasterOrg() {
        return masterOrg;
    }

    public void setMasterOrg(Orgnization masterOrg) {
        this.masterOrg = masterOrg;
    }

}
